<%@page import="com.google.appengine.api.datastore.KeyFactory"%>
<%@page import="com.hrms.core.Constants"%>
<%@page import="com.hrms.core.Utils"%>
<%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="com.hrms.domain.BlockingStep"%>
<%@page import="java.util.List"%>
<%@page import="com.hrms.view.BlockingView"%>
<%@ taglib prefix="c" tagdir="/WEB-INF/tags" %>
<%
	BlockingView blockingView = new BlockingView();
	blockingView.service(request, response);

	List<BlockingStep> bsList = blockingView.getBlockingSteps();
%>
<br>
<table id="<%=BlockingStep.TYPE%>" width="100%" cellpadding="4"
	border="0" cellspacing="1" class="testgrid">
	<tr class="ui-tabs-nav ui-helper-reset ui-widget-header ui-corner-all">
		<c:tableHeader title="Progress Item Ref" />
		<c:tableHeader title="Blocking Step" />
		<c:tableHeader title="Date" />
		<c:tableHeader title="Waiting For" />
		<c:tableHeader title="Status" />
		<c:tableHeader title="" />
	</tr>
	
<%   if(!bsList.isEmpty()){ %>	
	<%
		Integer no = 0;
		String namer = StringUtils.EMPTY;
		for (BlockingStep bs : bsList) {
			no++;
			namer = BlockingStep.TYPE +"_"+ no;
	%>
	<tr class="<%=Utils.rowStyle(no)%>" id="<%=namer%>">
		<td class="dbfieldLabel"><div id="<%=namer%>_taskKey"><%=bs.getTaskKey().getId()%></div>
		</td>
		<td class="dbfieldLabel"><div id="<%=namer%>_blockingStep"><%=bs.getBlockingStep()%></div>
		</td>
		<td class="dbfieldLabel"><div id="<%=namer%>_date"><%=Utils.formatToSimpleDate(bs.getDate())%></div>
		</td>
		<td class="dbfieldLabel"><div id="<%=namer%>_waitingFor"><%=bs.getWaitingFor()%></div>
		</td>
		<td class="dbfieldLabel"><div id="<%=namer%>_status"><%=bs.getStatus()%></div>
		</td>
		<td align="right" >
		</td>
	</tr>
	<%
		}
	%>
	<%
}else {
	%>
	<c:noResults colspan="7" />
	<%
		}
	%>
</table>